<!-- HTML header for doxygen 1.8.14-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="cache-control" content="max-age=86400"/>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GBDK 2020 Docs: gbdk-lib/include/gb/metasprites.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen_extra.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">GBDK 2020 Docs
   &#160;<span id="projectnumber">4.4.0</span>
   </div>
   <div id="projectbrief">API Documentation for GBDK 2020</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('gb_2metasprites_8h.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">metasprites.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;<a class="el" href="gb_2hardware_8h_source.html">gb/hardware.h</a>&gt;</code><br />
<code>#include &lt;types.h&gt;</code><br />
<code>#include &lt;<a class="el" href="stdint_8h_source.html">stdint.h</a>&gt;</code><br />
</div>
<p><a href="gb_2metasprites_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmetasprite__t.html">metasprite_t</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a9f9f390a57460914e27c7604b7d8379a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gb_2metasprites_8h.html#a9f9f390a57460914e27c7604b7d8379a">metasprite_end</a>&#160;&#160;&#160;-128</td></tr>
<tr class="separator:a9f9f390a57460914e27c7604b7d8379a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa88dc4d5e35045509b8955a4a23a30aa"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gb_2metasprites_8h.html#aa88dc4d5e35045509b8955a4a23a30aa">METASPR_ITEM</a>(dy,  dx,  dt,  a)&#160;&#160;&#160;{(dy),(dx),(dt),(a)}</td></tr>
<tr class="separator:aa88dc4d5e35045509b8955a4a23a30aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa1d425dcce3cd104751744535b6a389a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gb_2metasprites_8h.html#aa1d425dcce3cd104751744535b6a389a">METASPR_TERM</a>&#160;&#160;&#160;{<a class="el" href="sms_2metasprites_8h.html#a9f9f390a57460914e27c7604b7d8379a">metasprite_end</a>}</td></tr>
<tr class="separator:aa1d425dcce3cd104751744535b6a389a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:aba6401cc8173158a9f37ee22094c03d3"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structmetasprite__t.html">metasprite_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gb_2metasprites_8h.html#aba6401cc8173158a9f37ee22094c03d3">metasprite_t</a></td></tr>
<tr class="separator:aba6401cc8173158a9f37ee22094c03d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a7f682afd53ac62ba02b0b6bc18d9cae5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gb_2metasprites_8h.html#a7f682afd53ac62ba02b0b6bc18d9cae5">hide_sprites_range</a> (<a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> from, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> to)</td></tr>
<tr class="separator:a7f682afd53ac62ba02b0b6bc18d9cae5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6a320e8632e35cba926e089b035146e1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gb_2metasprites_8h.html#a6a320e8632e35cba926e089b035146e1">move_metasprite_ex</a> (const <a class="el" href="structmetasprite__t.html">metasprite_t</a> *metasprite, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_tile, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_prop, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_sprite, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> x, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> y)</td></tr>
<tr class="separator:a6a320e8632e35cba926e089b035146e1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a77475e913bf0a19df28bdbf9d1cf392b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gb_2metasprites_8h.html#a77475e913bf0a19df28bdbf9d1cf392b">move_metasprite</a> (const <a class="el" href="structmetasprite__t.html">metasprite_t</a> *metasprite, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_tile, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_sprite, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> x, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> y)</td></tr>
<tr class="separator:a77475e913bf0a19df28bdbf9d1cf392b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a061cc1e8214c86414dc1d5017b9c8be2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gb_2metasprites_8h.html#a061cc1e8214c86414dc1d5017b9c8be2">move_metasprite_flipx</a> (const <a class="el" href="structmetasprite__t.html">metasprite_t</a> *metasprite, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_tile, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_prop, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_sprite, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> x, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> y)</td></tr>
<tr class="separator:a061cc1e8214c86414dc1d5017b9c8be2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8ff2df0679ebb0b6e0a8f6d83127e1a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gb_2metasprites_8h.html#aa8ff2df0679ebb0b6e0a8f6d83127e1a">move_metasprite_vflip</a> (const <a class="el" href="structmetasprite__t.html">metasprite_t</a> *metasprite, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_tile, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_sprite, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> x, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> y)</td></tr>
<tr class="separator:aa8ff2df0679ebb0b6e0a8f6d83127e1a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4de12dbe1868a2a408e8ef583ccc9df1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gb_2metasprites_8h.html#a4de12dbe1868a2a408e8ef583ccc9df1">move_metasprite_flipy</a> (const <a class="el" href="structmetasprite__t.html">metasprite_t</a> *metasprite, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_tile, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_prop, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_sprite, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> x, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> y)</td></tr>
<tr class="separator:a4de12dbe1868a2a408e8ef583ccc9df1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a27e3bb17d0458b60b1f0433f66301f46"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gb_2metasprites_8h.html#a27e3bb17d0458b60b1f0433f66301f46">move_metasprite_hflip</a> (const <a class="el" href="structmetasprite__t.html">metasprite_t</a> *metasprite, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_tile, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_sprite, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> x, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> y)</td></tr>
<tr class="separator:a27e3bb17d0458b60b1f0433f66301f46"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a21a071eea8fb69b577cfcd86aad5bdac"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gb_2metasprites_8h.html#a21a071eea8fb69b577cfcd86aad5bdac">move_metasprite_flipxy</a> (const <a class="el" href="structmetasprite__t.html">metasprite_t</a> *metasprite, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_tile, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_prop, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_sprite, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> x, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> y)</td></tr>
<tr class="separator:a21a071eea8fb69b577cfcd86aad5bdac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a32a61acd4a76d1de5814f7b94c8bc23f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gb_2metasprites_8h.html#a32a61acd4a76d1de5814f7b94c8bc23f">move_metasprite_hvflip</a> (const <a class="el" href="structmetasprite__t.html">metasprite_t</a> *metasprite, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_tile, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_sprite, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> x, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> y)</td></tr>
<tr class="separator:a32a61acd4a76d1de5814f7b94c8bc23f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af8de5a888d65448b9d34027a0e1ce906"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gb_2metasprites_8h.html#af8de5a888d65448b9d34027a0e1ce906">hide_metasprite</a> (const <a class="el" href="structmetasprite__t.html">metasprite_t</a> *metasprite, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_sprite)</td></tr>
<tr class="separator:af8de5a888d65448b9d34027a0e1ce906"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:aae51f066cc5436457f62351847bfc64b"><td class="memItemLeft" align="right" valign="top">const void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gb_2metasprites_8h.html#aae51f066cc5436457f62351847bfc64b">__current_metasprite</a></td></tr>
<tr class="separator:aae51f066cc5436457f62351847bfc64b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a345fa52509387bd18a4092178a18286f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gb_2metasprites_8h.html#a345fa52509387bd18a4092178a18286f">__current_base_tile</a></td></tr>
<tr class="separator:a345fa52509387bd18a4092178a18286f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af2dc6b61dc598c155217788049a5416b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gb_2metasprites_8h.html#af2dc6b61dc598c155217788049a5416b">__current_base_prop</a></td></tr>
<tr class="separator:af2dc6b61dc598c155217788049a5416b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4bfe4d95031b67951cf6bc342110db39"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gb_2metasprites_8h.html#a4bfe4d95031b67951cf6bc342110db39">__render_shadow_OAM</a></td></tr>
<tr class="separator:a4bfe4d95031b67951cf6bc342110db39"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="anchor" id="metasprite_main_docs"></a></p>
<h1><a class="anchor" id="autotoc_md2"></a>
Metasprite support</h1>
<p>A metasprite is a larger sprite made up from a collection of smaller individual hardware sprites. Different frames of the same metasprites can share tile data.</p>
<p>The api supports metasprites in both <a class="el" href="sms_8h.html#aa87bec0d134136fdb727f52cb773b792">SPRITES_8x8</a> and <a class="el" href="sms_8h.html#af91d252f07f4764996154820f970c101">SPRITES_8x16</a> mode. If 8x16 mode is used then the height of the metasprite must be a multiple of 16.</p>
<p>The origin (pivot) for the metasprite is not required to be in the upper left-hand corner as with regular hardware sprites.</p>
<p>Use the <a class="el" href="docs_toolchain.html#utility_png2asset">utility_png2asset</a> tool to convert single or multiple frames of graphics into metasprite structured data for use with the ...metasprite...() functions.</p>
<h1><a class="anchor" id="autotoc_md3"></a>
Metasprites composed of variable numbers of sprites</h1>
<p>When using png2asset, it's common for the output of different frames to be composed of different numbers of hardware sprites (since it's trying to create each frame as efficiently as possible). Due to that, it's good practice to clear out (hide) unused sprites in the shadow_OAM that have been set by previous frames.</p>
<div class="fragment"><div class="line"><span class="comment">// Example:</span></div>
<div class="line"><span class="comment">// Hide rest of the hardware sprites, because amount</span></div>
<div class="line"><span class="comment">// of sprites differ between animation frames.</span></div>
<div class="line"><span class="comment">// (where hiwater == last hardware sprite used + 1)</span></div>
<div class="line"><a class="code" href="gb_2metasprites_8h.html#a7f682afd53ac62ba02b0b6bc18d9cae5">hide_sprites_range</a>(hiwater, <a class="code" href="gb_8h.html#a8b77608c87a9aef65a03531482b2163b">MAX_HARDWARE_SPRITES</a>);</div>
<div class="ttc" id="agb_2metasprites_8h_html_a7f682afd53ac62ba02b0b6bc18d9cae5"><div class="ttname"><a href="gb_2metasprites_8h.html#a7f682afd53ac62ba02b0b6bc18d9cae5">hide_sprites_range</a></div><div class="ttdeci">void hide_sprites_range(uint8_t from, uint8_t to)</div></div>
<div class="ttc" id="agb_8h_html_a8b77608c87a9aef65a03531482b2163b"><div class="ttname"><a href="gb_8h.html#a8b77608c87a9aef65a03531482b2163b">MAX_HARDWARE_SPRITES</a></div><div class="ttdeci">#define MAX_HARDWARE_SPRITES</div><div class="ttdef"><b>Definition:</b> gb.h:1854</div></div>
</div><!-- fragment --><p><a class="anchor" id="metasprite_and_sprite_properties"></a></p>
<h1><a class="anchor" id="autotoc_md4"></a>
Metasprites and sprite properties (including cgb palette)</h1>
<p>When the move_metasprite_*() functions are called they update all properties for the affected sprites in the Shadow OAM. This means any existing property flags set for a sprite (CGB palette, BG/WIN priority, Tile VRAM Bank) will get overwritten.</p>
<p>How to use sprite property flags with metasprites:</p><ul>
<li>Primary method: Use the <code>base_prop</code> parameter for the move_metasprite_*() functions.<ul>
<li>For more details about the properties on the Game Boy see: <a href="https://gbdev.io/pandocs/OAM.html#byte-3&ndash;attributesflags">https://gbdev.io/pandocs/OAM.html#byte-3&amp;ndash;attributesflags</a></li>
<li>This can be left at zero for defaults</li>
<li>Various <code>OAMF_*</code> flags can be used depending on the platform:<ul>
<li><a class="el" href="gb_2hardware_8h.html#aade9a193ade9ff22ed6f6263d1a3549b">OAMF_BANK0</a>, <a class="el" href="gb_2hardware_8h.html#ad195d4be68ff54c3926c431fa5511de5">OAMF_BANK1</a></li>
<li><a class="el" href="gb_2hardware_8h.html#a4ff8c8a7acb74ba54043596110091605">OAMF_CGB_PAL0</a>, <a class="el" href="gb_2hardware_8h.html#a9dff52d03755812d3a5ee7ca971c2e83">OAMF_CGB_PAL1</a>, <a class="el" href="gb_2hardware_8h.html#a74744fb475532fa5d343e0818dcc6f88">OAMF_CGB_PAL2</a>, <a class="el" href="gb_2hardware_8h.html#a704ab20694793ea87aace8bfc29568bc">OAMF_CGB_PAL3</a>, <a class="el" href="gb_2hardware_8h.html#a13d5cddfb4a05fa49fc794aeea675c7b">OAMF_CGB_PAL4</a>, <a class="el" href="gb_2hardware_8h.html#af9284c71b8ebf10ef8b9e12268f2cce3">OAMF_CGB_PAL5</a>, <a class="el" href="gb_2hardware_8h.html#ad6f5b0d9ae958dee3d6dfa8f4273ff5a">OAMF_CGB_PAL6</a>, <a class="el" href="gb_2hardware_8h.html#af4b27e8f3c3e14a4f91051fea4c64e4b">OAMF_CGB_PAL7</a>,</li>
<li><a class="el" href="gb_2hardware_8h.html#a22b6b835de9ee737be73c4d252aac87c">OAMF_PAL0</a>, <a class="el" href="gb_2hardware_8h.html#ad92f3b2a1cc16700a4660c5821bcb15d">OAMF_PAL1</a>,</li>
<li><a class="el" href="gb_2hardware_8h.html#a5dc4d1ee47fe269761fe8fc46d56dabb">OAMF_PALMASK</a>, <a class="el" href="gb_2hardware_8h.html#a393866ca405b1023eec0e784bb88b026">OAMF_PRI</a>, <a class="el" href="gb_2hardware_8h.html#a3cd1c1a1291d43dd43b181ff07f8b0a7">OAMF_XFLIP</a>, <a class="el" href="gb_2hardware_8h.html#a820677d593625e8716c3b78f36feb805">OAMF_YFLIP</a></li>
</ul>
</li>
</ul>
</li>
<li>Alternate method: The metasprite structures can have the property flags modified before compilation (such as with <code>-sp &lt;props&gt;</code> in the <a class="el" href="docs_toolchain.html#utility_png2asset">png2asset</a> tool).</li>
</ul>
<p>The following functions only support hardware sprite flipping on the Game Boy / Mega Duck and NES. For other consoles which do not have hardware sprite flipping see the cross-platform metasprite example for a workaround (with some performance penalty).</p>
<ul>
<li><a class="el" href="gb_2metasprites_8h.html#a061cc1e8214c86414dc1d5017b9c8be2">move_metasprite_flipx()</a></li>
<li><a class="el" href="gb_2metasprites_8h.html#a4de12dbe1868a2a408e8ef583ccc9df1">move_metasprite_flipy()</a></li>
<li><a class="el" href="gb_2metasprites_8h.html#a21a071eea8fb69b577cfcd86aad5bdac">move_metasprite_flipxy()</a></li>
</ul>
<p>To test for hardware support see <a class="el" href="sms_8h.html#afc296eacbda6a42f2a71aacab376ceb7">HARDWARE_SPRITE_CAN_FLIP_X</a> and <a class="el" href="sms_8h.html#a9119d69d971f6bee9e55d0df8f0ac983">HARDWARE_SPRITE_CAN_FLIP_Y</a>. Also see <a class="el" href="docs_supported_consoles.html#docs_consoles_supported_list">docs_consoles_supported_list</a> for a brief summary of console capabilities. </p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a9f9f390a57460914e27c7604b7d8379a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9f9f390a57460914e27c7604b7d8379a">&#9670;&nbsp;</a></span>metasprite_end</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define metasprite_end&#160;&#160;&#160;-128</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="aa88dc4d5e35045509b8955a4a23a30aa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa88dc4d5e35045509b8955a4a23a30aa">&#9670;&nbsp;</a></span>METASPR_ITEM</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define METASPR_ITEM</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">dy, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">dx, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">dt, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">a&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;{(dy),(dx),(dt),(a)}</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="aa1d425dcce3cd104751744535b6a389a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa1d425dcce3cd104751744535b6a389a">&#9670;&nbsp;</a></span>METASPR_TERM</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define METASPR_TERM&#160;&#160;&#160;{<a class="el" href="sms_2metasprites_8h.html#a9f9f390a57460914e27c7604b7d8379a">metasprite_end</a>}</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="aba6401cc8173158a9f37ee22094c03d3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aba6401cc8173158a9f37ee22094c03d3">&#9670;&nbsp;</a></span>metasprite_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structmetasprite__t.html">metasprite_t</a> <a class="el" href="structmetasprite__t.html">metasprite_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Metasprite sub-item structure </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dy</td><td>(int8_t) Y coordinate of the sprite relative to the metasprite origin (pivot) </td></tr>
    <tr><td class="paramname">dx</td><td>(int8_t) X coordinate of the sprite relative to the metasprite origin (pivot) </td></tr>
    <tr><td class="paramname">dtile</td><td>(uint8_t) Start tile relative to the metasprites own set of tiles </td></tr>
    <tr><td class="paramname">props</td><td>(uint8_t) Property Flags</td></tr>
  </table>
  </dd>
</dl>
<p>Metasprites are built from multiple <a class="el" href="structmetasprite__t.html">metasprite_t</a> items (one for each sub-sprite) and a pool of tiles they reference. If a metasprite has multiple frames then each frame will be built from some number of <a class="el" href="structmetasprite__t.html">metasprite_t</a> items (which may vary based on how many sprites are required for that particular frame).</p>
<p>A metasprite frame is terminated with a {metasprite_end} entry. </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a7f682afd53ac62ba02b0b6bc18d9cae5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7f682afd53ac62ba02b0b6bc18d9cae5">&#9670;&nbsp;</a></span>hide_sprites_range()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void hide_sprites_range </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>from</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>to</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Hides all hardware sprites in range from &lt;= X &lt; to </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">from</td><td>start OAM index </td></tr>
    <tr><td class="paramname">to</td><td>finish OAM index (must be &lt;= MAX_HARDWARE_SPRITES)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="sms_8h.html#ad22c51635d052399bbbe1777999c794d">hide_sprite</a>, <a class="el" href="sms_8h.html#a8b77608c87a9aef65a03531482b2163b">MAX_HARDWARE_SPRITES</a></dd></dl>
<p>Hides all hardware sprites in range from &lt;= X &lt; to </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">from</td><td>start OAM index </td></tr>
    <tr><td class="paramname">to</td><td>finish OAM index </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a6a320e8632e35cba926e089b035146e1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6a320e8632e35cba926e089b035146e1">&#9670;&nbsp;</a></span>move_metasprite_ex()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> move_metasprite_ex </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structmetasprite__t.html">metasprite_t</a> *&#160;</td>
          <td class="paramname"><em>metasprite</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>base_tile</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>base_prop</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>base_sprite</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>y</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Moves metasprite to the absolute position x and y</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">metasprite</td><td>Pointer to the first struct of the metasprite (for the desired frame) </td></tr>
    <tr><td class="paramname">base_tile</td><td>Number of the first tile where the metasprite's tiles start </td></tr>
    <tr><td class="paramname">base_prop</td><td>Base sprite property flags (can be used to set palette, etc) </td></tr>
    <tr><td class="paramname">base_sprite</td><td>Number of the first hardware sprite to be used by the metasprite </td></tr>
    <tr><td class="paramname">x</td><td>Absolute x coordinate of the sprite </td></tr>
    <tr><td class="paramname">y</td><td>Absolute y coordinate of the sprite</td></tr>
  </table>
  </dd>
</dl>
<p>Moves <b>metasprite</b> to the absolute position <b>x</b> and <b>y</b> (with <b>no flip</b> on the X or Y axis). Hardware sprites are allocated starting from <b>base_sprite</b>, using tiles starting from <b>base_tile</b>.</p>
<p>Sets: </p><ul>
<li>__current_metasprite = metasprite; </li>
<li>__current_base_tile = base_tile;</li>
</ul>
<p>Note: Overwrites OAM sprite properties (such as CGB Palette), see <a class="el" href="gb_2metasprites_8h.html#metasprite_and_sprite_properties">Metasprites and sprite properties</a>.</p>
<dl class="section return"><dt>Returns</dt><dd>Number of hardware sprites used to draw this metasprite </dd></dl>

</div>
</div>
<a id="a77475e913bf0a19df28bdbf9d1cf392b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a77475e913bf0a19df28bdbf9d1cf392b">&#9670;&nbsp;</a></span>move_metasprite()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> move_metasprite </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structmetasprite__t.html">metasprite_t</a> *&#160;</td>
          <td class="paramname"><em>metasprite</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>base_tile</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>base_sprite</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>y</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Obsolete. This function has been replaced by <a class="el" href="gb_2metasprites_8h.html#a6a320e8632e35cba926e089b035146e1">move_metasprite_ex()</a> </p>

</div>
</div>
<a id="a061cc1e8214c86414dc1d5017b9c8be2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a061cc1e8214c86414dc1d5017b9c8be2">&#9670;&nbsp;</a></span>move_metasprite_flipx()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> move_metasprite_flipx </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structmetasprite__t.html">metasprite_t</a> *&#160;</td>
          <td class="paramname"><em>metasprite</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>base_tile</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>base_prop</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>base_sprite</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>y</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Moves metasprite to the absolute position x and y, <b>flipped by X (horizontally)</b></p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">metasprite</td><td>Pointer to the first struct of the metasprite (for the desired frame) </td></tr>
    <tr><td class="paramname">base_tile</td><td>Number of the first tile where the metasprite's tiles start </td></tr>
    <tr><td class="paramname">base_prop</td><td>Base sprite property flags (can be used to set palette, etc) </td></tr>
    <tr><td class="paramname">base_sprite</td><td>Number of the first hardware sprite to be used by the metasprite </td></tr>
    <tr><td class="paramname">x</td><td>Absolute x coordinate of the sprite </td></tr>
    <tr><td class="paramname">y</td><td>Absolute y coordinate of the sprite</td></tr>
  </table>
  </dd>
</dl>
<p>Same as <a class="el" href="gb_2metasprites_8h.html#a77475e913bf0a19df28bdbf9d1cf392b">move_metasprite()</a>, but with the metasprite flipped by X (horizontally).</p>
<p>Sets: </p><ul>
<li>__current_metasprite = metasprite; </li>
<li>__current_base_tile = base_tile;</li>
</ul>
<p>Note: Overwrites OAM sprite properties (such as CGB palette), see <a class="el" href="gb_2metasprites_8h.html#metasprite_and_sprite_properties">Metasprites and sprite properties</a>.</p>
<p>This function is only available on Game Boy and related clone consoles.</p>
<dl class="section return"><dt>Returns</dt><dd>Number of hardware sprites used to draw this metasprite</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="gb_2metasprites_8h.html#a77475e913bf0a19df28bdbf9d1cf392b">move_metasprite()</a> </dd></dl>

</div>
</div>
<a id="aa8ff2df0679ebb0b6e0a8f6d83127e1a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa8ff2df0679ebb0b6e0a8f6d83127e1a">&#9670;&nbsp;</a></span>move_metasprite_vflip()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> move_metasprite_vflip </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structmetasprite__t.html">metasprite_t</a> *&#160;</td>
          <td class="paramname"><em>metasprite</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>base_tile</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>base_sprite</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>y</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Obsolete. This function has been replaced by <a class="el" href="gb_2metasprites_8h.html#a061cc1e8214c86414dc1d5017b9c8be2">move_metasprite_flipx()</a> </p>

</div>
</div>
<a id="a4de12dbe1868a2a408e8ef583ccc9df1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4de12dbe1868a2a408e8ef583ccc9df1">&#9670;&nbsp;</a></span>move_metasprite_flipy()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> move_metasprite_flipy </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structmetasprite__t.html">metasprite_t</a> *&#160;</td>
          <td class="paramname"><em>metasprite</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>base_tile</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>base_prop</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>base_sprite</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>y</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Moves metasprite to the absolute position x and y, <b>flipped by Y (vertically)</b></p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">metasprite</td><td>Pointer to the first struct of the metasprite (for the desired frame) </td></tr>
    <tr><td class="paramname">base_tile</td><td>Number of the first tile where the metasprite's tiles start </td></tr>
    <tr><td class="paramname">base_prop</td><td>Base sprite property flags (can be used to set palette, etc) </td></tr>
    <tr><td class="paramname">base_sprite</td><td>Number of the first hardware sprite to be used by the metasprite </td></tr>
    <tr><td class="paramname">x</td><td>Absolute x coordinate of the sprite </td></tr>
    <tr><td class="paramname">y</td><td>Absolute y coordinate of the sprite</td></tr>
  </table>
  </dd>
</dl>
<p>Same as <a class="el" href="gb_2metasprites_8h.html#a77475e913bf0a19df28bdbf9d1cf392b">move_metasprite()</a>, but with the metasprite flipped by Y (vertically).</p>
<p>Sets: </p><ul>
<li>__current_metasprite = metasprite; </li>
<li>__current_base_tile = base_tile;</li>
</ul>
<p>Note: Overwrites OAM sprite properties (such as CGB palette), see <a class="el" href="gb_2metasprites_8h.html#metasprite_and_sprite_properties">Metasprites and sprite properties</a>.</p>
<p>This function is only available on Game Boy and related clone consoles.</p>
<dl class="section return"><dt>Returns</dt><dd>Number of hardware sprites used to draw this metasprite</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="gb_2metasprites_8h.html#a77475e913bf0a19df28bdbf9d1cf392b">move_metasprite()</a> </dd></dl>

</div>
</div>
<a id="a27e3bb17d0458b60b1f0433f66301f46"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a27e3bb17d0458b60b1f0433f66301f46">&#9670;&nbsp;</a></span>move_metasprite_hflip()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> move_metasprite_hflip </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structmetasprite__t.html">metasprite_t</a> *&#160;</td>
          <td class="paramname"><em>metasprite</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>base_tile</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>base_sprite</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>y</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Obsolete. This function has been replaced by <a class="el" href="gb_2metasprites_8h.html#a4de12dbe1868a2a408e8ef583ccc9df1">move_metasprite_flipy()</a> </p>

</div>
</div>
<a id="a21a071eea8fb69b577cfcd86aad5bdac"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a21a071eea8fb69b577cfcd86aad5bdac">&#9670;&nbsp;</a></span>move_metasprite_flipxy()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> move_metasprite_flipxy </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structmetasprite__t.html">metasprite_t</a> *&#160;</td>
          <td class="paramname"><em>metasprite</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>base_tile</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>base_prop</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>base_sprite</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>y</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Moves metasprite to the absolute position x and y, <b>flipped by X and Y (horizontally and vertically)</b></p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">metasprite</td><td>Pointer to the first struct of the metasprite (for the desired frame) </td></tr>
    <tr><td class="paramname">base_tile</td><td>Number of the first tile where the metasprite's tiles start </td></tr>
    <tr><td class="paramname">base_prop</td><td>Base sprite property flags (can be used to set palette, etc) </td></tr>
    <tr><td class="paramname">base_sprite</td><td>Number of the first hardware sprite to be used by the metasprite </td></tr>
    <tr><td class="paramname">x</td><td>Absolute x coordinate of the sprite </td></tr>
    <tr><td class="paramname">y</td><td>Absolute y coordinate of the sprite</td></tr>
  </table>
  </dd>
</dl>
<p>Same as <a class="el" href="gb_2metasprites_8h.html#a77475e913bf0a19df28bdbf9d1cf392b">move_metasprite()</a>, but with the metasprite flipped by X and Y (horizontally and vertically).</p>
<p>Sets: </p><ul>
<li>__current_metasprite = metasprite; </li>
<li>__current_base_tile = base_tile;</li>
</ul>
<p>Note: Overwrites OAM sprite properties (such as CGB palette), see <a class="el" href="gb_2metasprites_8h.html#metasprite_and_sprite_properties">Metasprites and sprite properties</a>.</p>
<p>This function is only available on Game Boy and related clone consoles.</p>
<dl class="section return"><dt>Returns</dt><dd>Number of hardware sprites used to draw this metasprite</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="gb_2metasprites_8h.html#a77475e913bf0a19df28bdbf9d1cf392b">move_metasprite()</a> </dd></dl>

</div>
</div>
<a id="a32a61acd4a76d1de5814f7b94c8bc23f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a32a61acd4a76d1de5814f7b94c8bc23f">&#9670;&nbsp;</a></span>move_metasprite_hvflip()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> move_metasprite_hvflip </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structmetasprite__t.html">metasprite_t</a> *&#160;</td>
          <td class="paramname"><em>metasprite</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>base_tile</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>base_sprite</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>y</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Obsolete. This function has been replaced by <a class="el" href="gb_2metasprites_8h.html#a21a071eea8fb69b577cfcd86aad5bdac">move_metasprite_flipxy()</a> </p>

</div>
</div>
<a id="af8de5a888d65448b9d34027a0e1ce906"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af8de5a888d65448b9d34027a0e1ce906">&#9670;&nbsp;</a></span>hide_metasprite()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void hide_metasprite </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structmetasprite__t.html">metasprite_t</a> *&#160;</td>
          <td class="paramname"><em>metasprite</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>base_sprite</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Hides a metasprite from the screen</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">metasprite</td><td>Pointer to first struct of the desired metasprite frame </td></tr>
    <tr><td class="paramname">base_sprite</td><td>Number of hardware sprite to start with</td></tr>
  </table>
  </dd>
</dl>
<p>Sets: </p><ul>
<li>__current_metasprite = metasprite; </li>
</ul>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="aae51f066cc5436457f62351847bfc64b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aae51f066cc5436457f62351847bfc64b">&#9670;&nbsp;</a></span>__current_metasprite</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const void* __current_metasprite</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">extern</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="a345fa52509387bd18a4092178a18286f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a345fa52509387bd18a4092178a18286f">&#9670;&nbsp;</a></span>__current_base_tile</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> __current_base_tile</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">extern</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="af2dc6b61dc598c155217788049a5416b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af2dc6b61dc598c155217788049a5416b">&#9670;&nbsp;</a></span>__current_base_prop</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> __current_base_prop</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">extern</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="a4bfe4d95031b67951cf6bc342110db39"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4bfe4d95031b67951cf6bc342110db39">&#9670;&nbsp;</a></span>__render_shadow_OAM</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> __render_shadow_OAM</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">extern</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.14-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
</div>
</body>
</html>
